﻿@model Logistics.Web.Models.Order.ShippingOptionModel
@using Nop.Core.Domain.Common

@using (Html.BeginForm("ShippingOption", "Order"))
{
    <h2>1) Shipping Options</h2>
    <div class="col-ms-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 package-shipping-option-container">

        <p>You may choose a business or personnel name to be displayed at the "Order By" section of the shipping label:</p>
        @Html.TextBoxFor(model => model.OrderByInfo, new { @class = "form-control" })
    </div>
    <div class="col-ms-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 package-shipping-instruction-container">
        <p>You may enter special shipping instruction(s) regarding this order:</p>
        @Html.TextAreaFor(model => model.AdditionalInstruction, new { @class = "form-control" })
    </div>

    <div class="col-ms-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 package-gift-card-container">
        <h3>2) Gift Card</h3>
        <div class="logistics-giftcard-message"></div>
        <div class="giftcard-container">
            @Html.Partial("GiftCardInfo", Model)
        </div>
        <div class="logistics-giftcard-loading">
            <img class="loading-svg" src="/Content/images/loading.svg" />
            <img class="loading-gif" src="/Content/images/loading.gif" />
        </div>
    </div>

    
    if (Model.CanSetSignatureRequirement)
    {
        <div class="col-ms-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 package-signature-container">
            <h3>4) Receiver Signature Required?</h3>
            @Html.RadioButtonFor(model => model.NoSignature, false)
            <label for="NoSignature">Yes</label>
            <div class="package-line">
                @Html.RadioButtonFor(model => model.NoSignature, true, new { @id = "NoSignature1" })
                <label for="NoSignature1">No, leave at door (one delivery attempt only)</label>
            </div>
            <div class="package-line">
                <br />
                <p><em>** Any packages with "No Signature Required" selected will not qualify for the free insurance coverage.</em></p>
            </div>
        </div>
    }

    <input type="button" class="btn btn-block btn-primary" data-action="submit" value="Continue" />

    <script>
        $(document).ready(function () {
            checkHasPickUpDate(false);
            $("input[name=HasPickupDate]").change(function () {
                checkHasPickUpDate(true);
            });
            function checkHasPickUpDate(animation) {
                if ($("input[name=HasPickupDate]:checked").val() == "true") {
                    if (animation == true) {
                        $(".pickup-calendar-wrapper").stop().animate({ height: $(".pickup-calendar").outerHeight(true) });
                    } else {
                        $(".pickup-calendar-wrapper").css("height", "auto");
                    }
                } else {
                    if (animation == true) {
                        $(".pickup-calendar-wrapper").stop().animate({ height: 0 });
                    } else {
                        $(".pickup-calendar-wrapper").css("height", 0);
                    }
                }
            }
            
        });
    </script>
}